package com.work.saturn.bean;

import android.os.Parcel;
import android.os.Parcelable;

import com.immo.libcommon.base.BaseBean;

import java.io.Serializable;
import java.util.List;

@SuppressWarnings("unused")
public class InterestDetailBean extends BaseBean implements Serializable, Parcelable {

    /**
     * payload : {"txId":"2d3d922188d4577040f381331395409d5972deecbe71ba25b6ea5fe91bcdd267","blockNum":"25","payload":{"content":"今年世界杯哪个国家会夺冠？","count1":0,"count2":0,"count3":0,"count4":0,"count5":0,"createTime":1532575097000,"creator":"admin","endTime":"20180715","history":[{"amount":0,"chooseOption":"option1","from":"admin","timestamp":1532575097000,"to":"admin","tokenName":"GZH"}],"judgePerson":"admin","name":"worldCup","option1":"德国","option2":"法国","option3":"巴西","option4":"尼日利亚","option5":"葡萄牙","result":"Undecided"}}
     */

    private PayloadBeanX payload;

    public PayloadBeanX getPayload() {
        return payload;
    }

    public void setPayload(PayloadBeanX payload) {
        this.payload = payload;
    }

    public static class PayloadBeanX implements Serializable, Parcelable {
        /**
         * txId : 2d3d922188d4577040f381331395409d5972deecbe71ba25b6ea5fe91bcdd267
         * blockNum : 25
         * payload : {"content":"今年世界杯哪个国家会夺冠？","count1":0,"count2":0,"count3":0,"count4":0,"count5":0,"createTime":1532575097000,"creator":"admin","endTime":"20180715","history":[{"amount":0,"chooseOption":"option1","from":"admin","timestamp":1532575097000,"to":"admin","tokenName":"GZH"}],"judgePerson":"admin","name":"worldCup","option1":"德国","option2":"法国","option3":"巴西","option4":"尼日利亚","option5":"葡萄牙","result":"Undecided"}
         */

        private String txId;
        private String blockNum;
        private PayloadBean payload;

        public String getTxId() {
            return txId;
        }

        public void setTxId(String txId) {
            this.txId = txId;
        }

        public String getBlockNum() {
            return blockNum;
        }

        public void setBlockNum(String blockNum) {
            this.blockNum = blockNum;
        }

        public PayloadBean getPayload() {
            return payload;
        }

        public void setPayload(PayloadBean payload) {
            this.payload = payload;
        }

        public static class PayloadBean implements Serializable, Parcelable {
            /**
             * content : 今年世界杯哪个国家会夺冠？
             * count1 : 0
             * count2 : 0
             * count3 : 0
             * count4 : 0
             * count5 : 0
             * createTime : 1532575097000
             * creator : admin
             * endTime : 20180715
             * history : [{"amount":0,"chooseOption":"option1","from":"admin","timestamp":1532575097000,"to":"admin","tokenName":"GZH"}]
             * judgePerson : admin
             * name : worldCup
             * option1 : 德国
             * option2 : 法国
             * option3 : 巴西
             * option4 : 尼日利亚
             * option5 : 葡萄牙
             * result : Undecided
             */

            private String content;
            private int count1;
            private int count2;
            private int count3;
            private int count4;
            private int count5;
            private long createTime;
            private String creator;
            private String endTime;
            private String judgePerson;
            private String name;
            private String option1;
            private String option2;
            private String option3;
            private String option4;
            private String option5;
            private String result;
            private List<HistoryBean> history;

            public String getContent() {
                return content;
            }

            public void setContent(String content) {
                this.content = content;
            }

            public int getCount1() {
                return count1;
            }

            public void setCount1(int count1) {
                this.count1 = count1;
            }

            public int getCount2() {
                return count2;
            }

            public void setCount2(int count2) {
                this.count2 = count2;
            }

            public int getCount3() {
                return count3;
            }

            public void setCount3(int count3) {
                this.count3 = count3;
            }

            public int getCount4() {
                return count4;
            }

            public void setCount4(int count4) {
                this.count4 = count4;
            }

            public int getCount5() {
                return count5;
            }

            public void setCount5(int count5) {
                this.count5 = count5;
            }

            public long getCreateTime() {
                return createTime;
            }

            public void setCreateTime(long createTime) {
                this.createTime = createTime;
            }

            public String getCreator() {
                return creator;
            }

            public void setCreator(String creator) {
                this.creator = creator;
            }

            public String getEndTime() {
                return endTime;
            }

            public void setEndTime(String endTime) {
                this.endTime = endTime;
            }

            public String getJudgePerson() {
                return judgePerson;
            }

            public void setJudgePerson(String judgePerson) {
                this.judgePerson = judgePerson;
            }

            public String getName() {
                return name;
            }

            public void setName(String name) {
                this.name = name;
            }

            public String getOption1() {
                return option1;
            }

            public void setOption1(String option1) {
                this.option1 = option1;
            }

            public String getOption2() {
                return option2;
            }

            public void setOption2(String option2) {
                this.option2 = option2;
            }

            public String getOption3() {
                return option3;
            }

            public void setOption3(String option3) {
                this.option3 = option3;
            }

            public String getOption4() {
                return option4;
            }

            public void setOption4(String option4) {
                this.option4 = option4;
            }

            public String getOption5() {
                return option5;
            }

            public void setOption5(String option5) {
                this.option5 = option5;
            }

            public String getResult() {
                return result;
            }

            public void setResult(String result) {
                this.result = result;
            }

            public List<HistoryBean> getHistory() {
                return history;
            }

            public void setHistory(List<HistoryBean> history) {
                this.history = history;
            }

            public static class HistoryBean implements Serializable, Parcelable {
                /**
                 * amount : 0
                 * chooseOption : option1
                 * from : admin
                 * timestamp : 1532575097000
                 * to : admin
                 * tokenName : GZH
                 */

                private int amount;
                private String chooseOption;
                private String from;
                private long timestamp;
                private String to;
                private String tokenName;

                public int getAmount() {
                    return amount;
                }

                public void setAmount(int amount) {
                    this.amount = amount;
                }

                public String getChooseOption() {
                    return chooseOption;
                }

                public void setChooseOption(String chooseOption) {
                    this.chooseOption = chooseOption;
                }

                public String getFrom() {
                    return from;
                }

                public void setFrom(String from) {
                    this.from = from;
                }

                public long getTimestamp() {
                    return timestamp;
                }

                public void setTimestamp(long timestamp) {
                    this.timestamp = timestamp;
                }

                public String getTo() {
                    return to;
                }

                public void setTo(String to) {
                    this.to = to;
                }

                public String getTokenName() {
                    return tokenName;
                }

                public void setTokenName(String tokenName) {
                    this.tokenName = tokenName;
                }

                @Override
                public int describeContents() {
                    return 0;
                }

                @Override
                public void writeToParcel(Parcel dest, int flags) {
                    dest.writeInt(this.amount);
                    dest.writeString(this.chooseOption);
                    dest.writeString(this.from);
                    dest.writeLong(this.timestamp);
                    dest.writeString(this.to);
                    dest.writeString(this.tokenName);
                }

                public HistoryBean() {
                }

                HistoryBean(Parcel in) {
                    this.amount = in.readInt();
                    this.chooseOption = in.readString();
                    this.from = in.readString();
                    this.timestamp = in.readLong();
                    this.to = in.readString();
                    this.tokenName = in.readString();
                }

                public static final Creator<HistoryBean> CREATOR = new Creator<HistoryBean>() {
                    @Override
                    public HistoryBean createFromParcel(Parcel source) {
                        return new HistoryBean(source);
                    }

                    @Override
                    public HistoryBean[] newArray(int size) {
                        return new HistoryBean[size];
                    }
                };
            }

            @Override
            public int describeContents() {
                return 0;
            }

            @Override
            public void writeToParcel(Parcel dest, int flags) {
                dest.writeString(this.content);
                dest.writeInt(this.count1);
                dest.writeInt(this.count2);
                dest.writeInt(this.count3);
                dest.writeInt(this.count4);
                dest.writeInt(this.count5);
                dest.writeLong(this.createTime);
                dest.writeString(this.creator);
                dest.writeString(this.endTime);
                dest.writeString(this.judgePerson);
                dest.writeString(this.name);
                dest.writeString(this.option1);
                dest.writeString(this.option2);
                dest.writeString(this.option3);
                dest.writeString(this.option4);
                dest.writeString(this.option5);
                dest.writeString(this.result);
                dest.writeTypedList(this.history);
            }

            public PayloadBean() {
            }

            PayloadBean(Parcel in) {
                this.content = in.readString();
                this.count1 = in.readInt();
                this.count2 = in.readInt();
                this.count3 = in.readInt();
                this.count4 = in.readInt();
                this.count5 = in.readInt();
                this.createTime = in.readLong();
                this.creator = in.readString();
                this.endTime = in.readString();
                this.judgePerson = in.readString();
                this.name = in.readString();
                this.option1 = in.readString();
                this.option2 = in.readString();
                this.option3 = in.readString();
                this.option4 = in.readString();
                this.option5 = in.readString();
                this.result = in.readString();
                this.history = in.createTypedArrayList(HistoryBean.CREATOR);
            }

            public static final Creator<PayloadBean> CREATOR = new Creator<PayloadBean>() {
                @Override
                public PayloadBean createFromParcel(Parcel source) {
                    return new PayloadBean(source);
                }

                @Override
                public PayloadBean[] newArray(int size) {
                    return new PayloadBean[size];
                }
            };
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.txId);
            dest.writeString(this.blockNum);
            dest.writeParcelable(this.payload, flags);
        }

        public PayloadBeanX() {
        }

        PayloadBeanX(Parcel in) {
            this.txId = in.readString();
            this.blockNum = in.readString();
            this.payload = in.readParcelable(PayloadBean.class.getClassLoader());
        }

        public static final Creator<PayloadBeanX> CREATOR = new Creator<PayloadBeanX>() {
            @Override
            public PayloadBeanX createFromParcel(Parcel source) {
                return new PayloadBeanX(source);
            }

            @Override
            public PayloadBeanX[] newArray(int size) {
                return new PayloadBeanX[size];
            }
        };
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeParcelable(this.payload, flags);
    }

    public InterestDetailBean() {
    }

    private InterestDetailBean(Parcel in) {
        this.payload = in.readParcelable(PayloadBeanX.class.getClassLoader());
    }

    public static final Creator<InterestDetailBean> CREATOR = new Creator<InterestDetailBean>() {
        @Override
        public InterestDetailBean createFromParcel(Parcel source) {
            return new InterestDetailBean(source);
        }

        @Override
        public InterestDetailBean[] newArray(int size) {
            return new InterestDetailBean[size];
        }
    };
}
